package com.jiashihui.schema_lgorithm.schema.observer;

/**
 * @author jiashihui
 * @describe: 观察者模式测试类
 * @date 2019/03/14
 *
 * 当一个对象变化时，其它依赖该对象的对象都会收到通知，并且随着变化！
 */
public class ObserverTest {
    public static void main(String[] args) {
        HeadHunterImpl subject = new HeadHunterImpl();
        subject.addObserver(new JobSeekerImpl("Mike"));
        subject.addObserver(new JobSeekerImpl("Jeff"));
        subject.addJob("Google Job");
        subject.addJob("Apple Job");
    }
}
